Skip to content

Convert rpk ai reference to single-source stubs of docs partials - #161

Merged
micheleRP merged 4 commits into
mainfrom
convert-rpk-ai-to-stubs
Jul 29, 2026
Merged

Convert rpk ai reference to single-source stubs of docs partials#161
micheleRP merged 4 commits into
mainfrom
convert-rpk-ai-to-stubs

Conversation

@JakeSCahill

Copy link
Copy Markdown
Contributor

Per the canonical-home discussion: the docs repo generates the rpk ai reference (marked asPartial in rpk-overrides.json, written to modules/reference/partials/rpk-ai/), so this component's 94 locally generated copies are replaced with 101 single-source stubs — the same pattern as the other shared rpk pages.

What you get immediately:

  • rpai 0.2.31 content with no regen: the llm-provider/mcp-server renames and the complete new policy group (apply/create/delete/diff/get/list/update) are already current in the docs partials.
  • 21 stubs carry :page-aliases: for the renamed old URLs (rpk-ai-llm-*rpk-ai-llm-provider-*, rpk-ai-mcp-*rpk-ai-mcp-server-*).
  • Nav rebuilt from the current command tree.

Dropped without successors: the three rpk ai connection pages — that command is exclude: true in the upstream overrides (deliberately undocumented). Add redirects if those URLs carry traffic.

⚠️ Merge after redpanda-data/docs#1840 (the 26.2 GA merge): the llm-provider/mcp-server/policy partials these stubs include only reach docs main with that PR. Until then this branch's includes don't resolve. Its preview will also stay red until #1840 lands, for the same duplicate-component-version reason as #159/#160.

Note: one stale pre-rename partial (rpk-ai-mcp-create.adoc) still exists in the docs repo and is intentionally not stubbed; we're deleting it upstream as follow-up cleanup.

The docs repo is the generation home for rpk ai (asPartial in
rpk-overrides.json, generated into reference partials). This replaces
the 94 locally generated pages with 101 stubs that include those
partials, picking up the rpai 0.2.31 llm-provider/mcp-server renames
and the new policy command group.

- 21 renamed pages carry page-aliases for their old URLs
- rpk ai connection pages dropped (command excluded upstream)
- nav rebuilt from the current command tree
@JakeSCahill
JakeSCahill requested a review from a team as a code owner July 28, 2026 17:03
@netlify

netlify Bot commented Jul 28, 2026

Copy link
Copy Markdown

Deploy Preview for redpanda-agentic-data-plane ready!

Name Link
🔨 Latest commit 261f062
🔍 Latest deploy log https://app.netlify.com/projects/redpanda-agentic-data-plane/deploys/6a6a2434f8127400081ba137
😎 Deploy Preview https://deploy-preview-161--redpanda-agentic-data-plane.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@micheleRP

Copy link
Copy Markdown
Contributor

Before this merges: the new rpk ai policy stubs would be the first published docs for the policy commands, and there's a pending product decision on whether and how those get documented (I've asked separately). Two options so the rest of this PR isn't blocked: hold the merge until that's answered, or split the policy stubs (the 8 rpk-ai-policy* pages plus their nav entries) into a follow-up PR. Everything else here looks ready to go once redpanda-data/docs#1840 lands.

@micheleRP

Copy link
Copy Markdown
Contributor

Docs review

The architecture here is right and the plumbing is almost entirely correct, but there are three blockers before this can land.

Critical issues (must fix)

1. Alias collision that hard-fails the build. rpk-ai-llm-provider.adoc declares :page-aliases: reference:rpk/rpk-ai/rpk-ai-llm.adoc, but rpk-ai-llm.adoc is kept as a live stub and is still in nav (line 124, directly above rpk-ai-llm-provider.adoc). Antora throws on this rather than warning:

Page alias cannot reference an existing page: ...rpk-ai-llm.adoc

registerPageAlias in @antora/content-classifier throws when the alias target resolves to an existing page. That aborts the build unconditionally, independent of redpanda-data/docs#1840, and is very likely why the deploy preview failed.

Fix: delete rpk-ai-llm.adoc and its nav line, mirroring how rpk-ai-mcp.adoc was handled, then add the upstream rpk-ai-llm.adoc partial to the same follow-up cleanup as rpk-ai-mcp-create.adoc. It is stale for the same reason.

2. Every command flag disappears from the reference. The upstream partials contain almost no flag documentation:

Current pages New stubs
Distinct flags documented 95 8
Flag table rows 890 513 (about 510 are the repeated global-flags table)
Pages with a == Flags section 94 2 (rpk-ai-install, rpk-ai-upgrade, the rpk-native commands)

Checked against the 0.2.31 plugin: rpk ai llm-provider create --help has 32 flags, rpk ai mcp-server create --help has 23, and rpk ai auth login has --no-browser. None of them appear in the stubs. The plugin's own global flags are gone too: -o/--format, --no-color, -c/--rpai-config, -s/--rpai-endpoint, --rpai-environment, -v/--rpai-verbose, --token. What remains is a repeated rpk-core global-flags table. In fairness to that table, those flags are genuinely accepted (rpk ai auth status --profile foo is parsed by rpk), so it is not wrong, it is just all that is left.

This is a generator defect rather than anything wrong with the stub pattern, but merging is what publishes it. A reference where rpk ai mcp-server create lists none of its 23 flags is a net regression against what is live today, so the flag extraction for plugin commands should be fixed before this lands.

3. The Preview label is dropped from the entire rpk ai reference. All 94 current pages carry :page-preview: true. None of the 101 stubs do, and no upstream partial supplies it (0 of 102). Moving a feature out of Preview is a product decision, not a side effect of a refactor.

Fix: add :page-preview: true to each stub header. It sits above the include::, so it survives single-sourcing, the same way rpk-install.adoc keeps its hand-added attributes.

Suggestions

4. :description: is lost on all 101 pages, because the upstream tag::single-source[] marker sits below the attribute lines. This affects meta descriptions and search snippets. The existing rpk-profile stubs have the same gap, so it is pattern-level rather than new, but it would be worth fixing upstream by moving the tag marker above :description:.

5. Body text is degraded relative to the pages being replaced, and some descriptions are mangled. rpk-ai-auth-login.adoc has :description: 0 device authorization grant against Redpanda Cloud..., where "Run the OAuth 2." was eaten by the generator, and its body is one truncated sentence where the current page has the full device-flow explanation. It does not render here since it is outside the tag region, but it signals the generator needs attention before these partials become canonical.

6. Empty section gaps. The generator emits three to five blank lines where the Aliases and Flags sections would be, so pages render with odd vertical gaps between == Usage and == Examples.

Impact on other files

Not in this PR, but affected:

  • modules/cli/pages/index.adoc line 93: xref:reference:rpk/rpk-ai/rpk-ai-mcp.adoc[rpk ai mcp-server]. The label was updated in docs: remove stale Redpanda Cloud dependencies from the CLI and agent guides #160 but the target still points at a page this PR deletes. It resolves through the alias so nothing breaks, but it should point at rpk-ai-mcp-server.adoc directly.
  • modules/reference/pages/rpk/index.adoc line 9: still reads "rpk ai llm, rpk ai mcp, rpk ai oauth". The one spot docs: remove stale Redpanda Cloud dependencies from the CLI and agent guides #160's rename sweep missed.
  • modules/reference/pages/release-notes.adoc: no v0.2.31 entry. This PR is how the renames reach readers, so a release-notes line calling out llm to llm-provider and mcp to mcp-server would help anyone with older muscle memory.
  • No Cedar or access-policy concept page exists anywhere in this component (zero matches for cedar, access polic, or abac across modules/ on main), so the 8 rpk ai policy reference pages would land with nothing to link back to.
  • The three deleted rpk ai connection pages leave published URLs returning 404 with no alias. That is correct if the command is truly gone, but aliases or redirects are worth considering since those URLs were live.

PR description is now stale

One scope note: no local build was run for this review. Finding 1 is verified against Antora's alias-registration behavior and finding 2 against the installed 0.2.31 plugin. A build after fixing finding 1 is the right confirmation step.

Address review feedback on the stub conversion:
- Add :page-preview: true to all 101 stubs. The current pages carry it
  and moving rpk ai out of Preview is a product decision, not a side
  effect of single-sourcing. The attribute sits above the include so it
  survives regeneration of the upstream partials.
- Point the CLI index mcp-server link at rpk-ai-mcp-server.adoc
  directly instead of resolving through the alias.
- Update the rpk index intro to the renamed command families
  (llm-provider, mcp-server, oauth-provider).
- Merge main (#159, #160).
rpk-ai-llm-provider.adoc declares rpk-ai-llm.adoc as a page alias, and
Antora fails the build when an alias target resolves to a live page.
Delete the stub and its nav entry, matching how rpk-ai-mcp.adoc was
handled. The matching stale upstream partial is removed in
redpanda-data/docs#1849.

@micheleRP micheleRP left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed and verified locally — approving. This is the right resolution of the canonical-home question: docs repo stays the generation home (partials), adp-docs is the publication home, same pattern as rpk cloud → cloud-docs.

What I verified (against docs main as of today, post-#1840):

  • The stated merge blocker has cleared: docs main HEAD is the 26.2 GA merge (redpanda-data/docs#1840).
  • All 100 stub include targets exist in modules/reference/partials/rpk-ai/ on docs main, checked file-by-file, and every target carries the single-source tag. Coverage is complete in both directions (100 partials ↔ 100 stubs, nothing orphaned).
  • Component/coordinate check: streaming:reference:partial$... matches docs antora.yml (name: streaming).
  • 21 :page-aliases: entries cover the llmllm-provider and mcpmcp-server renames. Aliases live in the stubs, not the partials — consistent with the partials keeping page-aliases outside the tagged region.
  • Netlify deploy preview is green (it was red pre-#1840, as predicted in the description).

Non-blocking notes:

  1. The three dropped rpk ai connection pages have no redirects. If those URLs show up in analytics or Kapa traffic, add redirects as a follow-up; otherwise fine to leave.
  2. Operational coupling to be aware of: the stubs are static, so a future rpai release that adds a command produces a partial with no stub/nav entry here (command invisible on the ADP site), and one that removes a command deletes the partial and leaves a stub with an unresolved include. I'm raising this on redpanda-data/docs#1834 — the plugin-refresh workflow already computes new/removed commands per run, so it can flag when an adp-docs stub/nav follow-up is needed. Longer term, a stub/nav regenerator in this repo would close the loop.

@micheleRP
micheleRP merged commit cff7af4 into main Jul 29, 2026
4 checks passed
@micheleRP
micheleRP deleted the convert-rpk-ai-to-stubs branch July 29, 2026 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants